<#include "../common/common.ftl">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <base href="${basePath}">
    <title>Grid show</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="stylesheet" type="text/css" href="cep/css/grid.css">
	<script type="text/javascript" src="cep/js/sort.js"></script>
	<script type="text/javascript" src="cep/js/grid.js"></script>
	<script type="text/javascript" src="cep/js/validation/validation.js"></script>
  <script type="text/javascript" src="cep/js/validation/form_auto_validation.js"></script>
  </head>
  <body>
  <#if dataTable??><span class="grid_title">${dataTable.desc?string}</span>
  <#else><span>This page doesn't hava any data.</span>
  </#if>
  <#if dataTable.conditions?exists>
  <span>您可以在此输入过滤条件:</span><br/>
  <FORM name="cep_grid_query_form" method= "post" action="grid.was">
	<INPUT type="hidden" name="action" value="query" />
	<INPUT type="hidden" name="id" value="${dataTable.gridId?if_exists}" />
	<input type="hidden" name="topage" value="">
	<TABLE width="100%" cellspacing="1" cellpadding="3" style="background-color:#DDD38D">
	<#assign posi=-1>
	<#assign rowNum= dataTable.condColNum ? default (2)>
	<#list dataTable.conditions as feleO>
	    <#assign fele = feleO.widget>
		<#assign fht = fele.htmlType ? default ("text")>
		<#assign fn = feleO.field.fieldName>
		<#assign posi = posi + 1>
		<#if posi % rowNum == 0><tr></#if>
		<#if fht == "select">
			<td>${fele.dispText}</td>
			<td><SELECT name="${fn}" <#if fele.onchange?exists>onchange = "${fele.onchange}"</#if> limit="${fele.limits?if_exists}" msg="${fele.comment?if_exists}">
				<option value="">未选择</option>
				<#list fele.dispList as option>
				<option value="${option.key}">${option.value}</option>
				</#list>
			</SELECT></td>
		<#else>
			<td>${fele.dispText}</td>
			<TD><input type = '${fht}' name="${fn}" size="${fele.size ! 20}" limit="${fele.limits ! ''}" msg="${fele.comment ! ''}"></TD>
		</#if>
		<#if posi % rowNum == 1><tr></#if>
	</#list>
	<#if posi % rowNum != 1>
		<td colspan=${(posi % rowNum) * 2}></td></tr>
	</#if>
	<!-- 操作按纽 -->
	<td colspan="2">
	  <input type="button" onclick="queryData(this.form);" value="查询" id="but_quer"/>
	</td><td colspan="2"><span id="easy_mana_err_span"></span></td>
	  </tr>
	  </TABLE>
	</FORM>
</#if>
   	<span class="page_desc">Page:${dataTable.currentPage}/${dataTable.pageCount} &nbsp;&nbsp; ${dataTable.rows ? size} resords. Total record:${dataTable.recordCount}</span>
   	<br>
   	<#assign divcss = "single_grid_div">
   	<#if dataTable.conditions?exists>
   		<#assign divcss = "single_grid_div_cond">
   	</#if>
	<div class="${divcss}">
   	<table cellspacing="1" cellpadding="3">
   		<!-- 输出表头 -->
   		<tr style="font-weight: bold;cursor:pointer">
   			<td onclick="sort_this_table(this)">序号</td>
   			<#list dataTable.th as th>
   				<td onclick="sort_this_table(this)" <#if th.width?exists>width="${th.width}"</#if>>${th.value ? if_exists}</td>
   			</#list>
   		</tr>
   		<!-- 输出表数据 -->
   		<#list dataTable.rows as row>
   			<tr onmousemove="mOvr(this)" onmouseout="mOut(this)" onclick="selectRow(this)">
   			<td>${row_index + 1}</td>
   				<#list row as td>
   					<#assign dm = td.dispMode!"">
   					<#assign divid = "div_${row_index}_${td_index}">
   					<td <#if dm == "pop">onmouseover="dispTd('${divid}')" onmouseout="hideTd('${divid}')"</#if><#if td.onClick?exists> onclick=${td.onclick}</#if><#if td.onclick?exists> onclick=${td.onclick}</#if>><#if td.linkUrl?exists><a href="${td.linkUrl}"></#if>${td.goat ? default (td.value)}<#if td.linkUrl?exists></a></#if></td>
   					<#if dm == "pop">
   						<div id="${divid}" style="display:none">${td.value?if_exists}</div>
   					</#if>
   				</#list>
   			</tr>
   		</#list>
   	</table>
   	<@page_index dataTable.currentPage dataTable.pageCount/>
   	</div>
   	<div id="display" style="position:absolute;display: block;background:#F9F8E8;width:117;height:87;padding: 7px;"></div>
  </body>
</html>